#raise主动抛出异常
#abort 在网页当中抛出异常
from flask import Flask, abort, render_template

app = Flask(__name__)


@app.route('/index/user/<id>',methods=['POST','GET'])
def index():
    if id == '1':
        return  "sdjaklda"
    else:
        abort(500,"报错力")

#自定义错误处理方法
@app.errorhandler(404)
def handel_404_error(err):
    return render_template('404.html'),404
if __name__ == '__main__':
    app.run(debug=True)
